#!/bin/sh
###################
source /etc/profile
source /root/.bash_profile
##################
#######每天一次脚本执行

 function getRunLogPath(){
    datetime=$(date --date "0 days ago" +%Y%m%d)
    if [ ! -d "./logs" ];then
        mkdir ./logs
    fi
    LOG_RUN_PATH=/root/etl/SXNYZY/Timing/modelToApp/logs/$0_${datetime}.log
 }

    getRunLogPath
    LOCAL_PATH=/root/etl/SXNYZY/diagnosis
    cur_dateTime=$(date --date "0 days ago" +%Y%m%d%H%M)
    #学生上网流水表
    cd ${LOCAL_PATH}/basic/model/; sh basic_network_record.sh >> ${LOG_RUN_PATH} 2>&1
    if [ $? -eq 0 ]
        then echo "${cur_dateTime} sh basic_network_record 成功" >> ${LOG_RUN_PATH} 2>&1
        else echo "${cur_dateTime} sh basic_network_record 失败" >> ${LOG_RUN_PATH} 2>&1
    fi
    #一卡通消费流水信息表
    cd ${LOCAL_PATH}/basic/model/; sh basic_ecard_consume_record.sh >> ${LOG_RUN_PATH} 2>&1
    if [ $? -eq 0 ]
        then echo "${cur_dateTime} sh basic_ecard_consume_record 成功" >> ${LOG_RUN_PATH} 2>&1
        else echo "${cur_dateTime} sh basic_ecard_consume_record 失败" >> ${LOG_RUN_PATH} 2>&1
    fi
    #学生违纪明细表
    cd ${LOCAL_PATH}/student/model/; sh student_disciplinary_info.sh >> ${LOG_RUN_PATH} 2>&1
    if [ $? -eq 0 ]
        then echo "${cur_dateTime} sh student_disciplinary_info 成功" >> ${LOG_RUN_PATH} 2>&1
        else echo "${cur_dateTime} sh student_disciplinary_info 失败" >> ${LOG_RUN_PATH} 2>&1
    fi
    rm -rf *.java

